package com.yunhe.sms.view.student;

import com.yunhe.sms.mode.Student;

import java.util.Scanner;

public class StudentAdd {
    public static Student studentAddUI(){
        System.out.println("********************学员信息管理系统-学员管理-添加********************");
        Scanner sc = new Scanner(System.in);
        System.out.print("要添加学员学号：");
        try {
            Integer id = sc.nextInt();
            System.out.print("要添加学员姓名：");
            String name = sc.next();
            System.out.print("要添加学员年龄：");
            String age = sc.next();
            System.out.print("要添加学员性别：");
            String sex = sc.next();
            System.out.print("要添加学员电话：");
            String phone = sc.next();
            return new Student(id,name,age,sex,phone);
        }catch (Exception e){
            System.out.println("操作不合法！");
            return studentAddUI();
        }
    }
}
